//
//  ViewController.m
//  Modal
//
//  Created by 彭鹏 on 16/10/22.
//  Copyright © 2016年 pengpeng. All rights reserved.
//

#import "ViewController.h"
#import "PGModalViewController.h"
#import "PGView.h"
@interface ViewController ()

@end

@implementation ViewController


- (void)loadView {
    [super loadView];
    self.view = [[PGView alloc] initWithFrame:[UIScreen mainScreen].bounds];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor redColor];
    
    
    
    
    
}


- (void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];
    NSLog(@"%@",[UIApplication sharedApplication].keyWindow.rootViewController);
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    PGModalViewController *modalViewController = [[PGModalViewController alloc] init];
    
    modalViewController.vc = self;
    modalViewController.view.backgroundColor = [UIColor orangeColor];
    
    [self presentViewController:modalViewController animated:YES completion:nil];
}


- (void)dealloc {
    NSLog(@"ViewController   dealloc");
}



@end
